authController.$inject = ['authService','$location','$rootScope','$scope'];

function authController(authService,$location,$rootScope,$scope) {
  // var $ = require('jquery');
  var vm=this;
  console.log("xxxx");
  // var vm = $scope.vm;
  // vm.inconformity= false;
  // vm.inconformity=true;
  // vm.how_type = 2;
  

  vm.login = function() {
    console.log("xxxx");
    authService.login(vm.client,function(result){
      
      if(result.data.length == 0){
        vm.err = "用户名或密码错误！！";
        $location.path("/login");
      }else{
        sessionStorage.client = JSON.stringify(result.data);
        sessionStorage.flag = true;
        $location.path("/welcome");
      }
    });
  }
}

module.exports = authController;